<template>
  <div>
    <table border="1" cellspacing="0" align="center">
      <tr>
        <td>名称</td>
        <td>
          <span @click="get_goods">价格</span>
        </td>
        <td>
          <span @click="get_goods">库存</span>
        </td>
        <td>内容</td>
        <td>总评论数</td>
        <td>分类</td>
      </tr>
      <tr v-for="i in from">
        <td>{{i.name}}</td>
        <td>{{i.price}}</td>
        <td>{{i.repertory}}</td>
        <td>{{i.content}}</td>
        <td>{{i.comment}}</td>
        <td>{{i.cid.name}}</td>
      </tr>
    </table>
  </div>
</template>

<script>
export default {
  name: "show_goods",
  data(){
    return{
      from:[]
    }
  },
  methods:{
    get_goods(){
      this.$axios.get('users/goods/').then(res=>{
        if(res.data.code==200){
          this.from=res.data.matter
        }
      })
    }
  },
  mounted() {
    this.get_goods()
  }
}
</script>

<style scoped>

</style>
